package www.wcx;

import java.util.Map;

import org.apache.kafka.clients.producer.Partitioner;
import org.apache.kafka.common.Cluster;

/**
 * 项目: kafka
 * <p>
 * 功能描述:
 *
 * @author: WuChengXing
 * @create: 2020-12-29 20:13
 **/
public class CustomPartitionerNew implements Partitioner {

    @Override
    public void configure(Map<String, ?> configs) {

    }

    @Override
    public int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster) {
        // 控制分区
        return 0;
    }

    @Override
    public void close() {

    }

}
